<template>
  <div>
    <Editor :style="{opacity: isBoss ? 0.05 : 1 }"/>
  </div>

</template>

<script>

import {invoke} from "@/lib/utils";
import * as utils from '@/lib/utils'
import {chessboard} from "vue-chessboard";
import Editor from "@/components/boardEdit/Editor.vue";
import emitvue from "@/lib/emitvue";
export default {
  name: "EditHandle",
  data() {
    return {
      isDev: false,
      isBoss: false,
      boardColor: 'white',
      currentFen: utils.newGame
    }
  },
  props: {

  },
  methods: {
    getEditBoardInfo(data) {
      console.log("data", data)
    },
  },
  async mounted() {
    this.isDev = location.protocol.indexOf('http') !== -1
    // 如果是开发模式，默认走老板键
    const isHome = await invoke('isHome', null)
    if (isHome === 'true' || isHome === true) {

    } else {
      this.isBoss = this.isDev
    }
    emitvue.$on('editMove', (data)=> {
      console.log("editMove data", data)
    })
  },
  components: {
    chessboard,
    Editor
  },
  watch: {

  },
}
</script>


<style scoped>

</style>